﻿@using Telerik.Web.Mvc.UI
@using Nop.Admin.Models.Logistics

@{
    var gridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSize;

    ViewBag.Title = T("Admin.Configuration.Logistics.PackageNoteTemplate").Text;
}
@using (Html.BeginForm())
{
    <div class="section-header">
        <div class="title">
            <img src="@Url.Content("~/subsites/Administration/Content/images/ico-configuration.png")" alt="" />
            @T("Admin.Configuration.Logistics.PackageNoteTemplate")
        </div>
        <div class="options">
            <a href="@Url.Action("PackageNoteTemplateCreate")" class="t-button">@T("Admin.Common.AddNew")</a>
        </div>
    </div>
    <table class="adminContent">
        <tr>
            <td>
                @(Html.Telerik().Grid<LogisticsPackageNoteTemplateModel>()
                    .Name("failed-deliver-reason-grid")
                    .Columns(columns =>
                    {
                        columns.Bound(x => x.Id)
                            .Width(50);
                        columns.Bound(x => x.ReferenceId)
                            .Width(50);
                        columns.Bound(x => x.SystemName)
                            .Width(200);
                        columns.Bound(x => x.DisplayOrder)
                            .Width(50);
                        columns.Bound(x => x.Published)
                            .Width(50);
                        columns.Bound(x => x.Content);
                        columns.Bound(x => x.Id)
                            .Width(100)
                            .Centered()
                            .Template(x => Html.ActionLink(T("Admin.Common.Edit").Text, "PackageNoteTemplateEdit", new { id = x.Id }))
                            .ClientTemplate("<a href=\"PackageNoteTemplateEdit/<#= Id #>\">" + T("Admin.Common.Edit").Text + "</a>")
                            .Title(T("Admin.Common.Edit").Text);
                    })
                    .Pageable(settings => settings.PageSize(gridPageSize).Position(GridPagerPosition.Both))
                    .DataBinding(dataBinding =>
                    {
                        dataBinding.Ajax().Select("PackageNoteTemplateList", "Logistics");
                    })
                    .EnableCustomBinding(true))
            </td>
        </tr>
    </table>
}
